package com.example.love_margin.Service.Impl;

import com.example.love_margin.Entity.Sponsorship;
import com.example.love_margin.Mapper.SponsorshipMapper;
import com.example.love_margin.Service.SponsorshipService;
import com.example.love_margin.Untils.ResultCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class SponsorshipServiceImpl implements SponsorshipService {

    @Autowired
    SponsorshipMapper sponsorshipMapper;

    @Override
    public Object addSponsorship(Sponsorship sponsorship) {
        sponsorship.setSponsorship_state("unpass");
        if (sponsorshipMapper.addSponsorship(sponsorship) == 1){
            return ResultCode.SUCCESS.result(true);
        }
        return ResultCode.SUCCESS.result(false);
    }
}
